<!-- 购物车 -->
@extends('home.index.layout')
@section('content')
<!-- <link href="{{url('ho/css/cart.css')}}" rel="stylesheet" type="text/css"> -->
<link href="{{url('/ho/css/mycart.css')}}" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/ho/js/jquery.spinner.js"></script>
<!--  我的购物车 -->
<div class="cart">
    <div class="wrap">
        <h2>我的购物车
    <a class="on-shopping" href="{{url('/')}}">继续购物 &gt; &gt;</a>
</h2>
            <div class="cart-alert">          
{{--dd(Session('goods_list'))--}}



                <!-- 购物车开始 -->
                <table id="cartTable">
                    <thead>
                        <tr>
                            <th><label><input class="check-all check" type="checkbox"/>&nbsp;全选</label></th>
                            <th>商品</th>
                            <th>单价</th>
                            <th>数量</th>
                            <th>小计</th>
                            <th>规格</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    @if(session('goods_list'))
                    <tbody>
                        @foreach(session('goods_list') as $u) 
                            <tr id="{{$u['gid']}}">
                                <td class="checkbox"><input class="check-one check" type="checkbox"/></td>
                                <td class="goods"><img src="{{url('/uploads/gPhoto').'/'.$u['pic']}}" alt=""/><span>{{$u['gname']}}</span></td>
                                <td class="price">{{$u['gprice']}}</td>
                                <td class="count"><span class="reduce">-</span><input class="count-input" type="text" value="{{$u['count']}}"/><span class="add">+</span></td>
                                <td class="subtotal">{{$u['gprice']*$u['count']}}</td>
                                <td class="spec">1Kg/份</td>
                                <td class="operation"><span class="delete">删除</span></td>
                            </tr>
                        @endforeach
                    </tbody>
                </table>
                    @else
                </table>
                        <div class="order-none">亲爱的顾客，您的购物车空空的～<a href="{{url('/')}}">快去逛逛吧</a>～</div>
                    @endif
                <div class="foot" id="foot">
                    <label class="fl select-all"><input type="checkbox" class="check-all check"/>&nbsp;全选</label>
                    <a class="fl delete" id="deleteAll" href="javascript:;">删除</a>
                    <form action="{{url('/order/index')}}">
                        <input name="gid" type="hidden" id="weiyi" value="">
                        <button class="fr closing" onclick="">结 算</button>
                    </form>
                    <div class="fr total">合计：￥<span id="priceTotal">0.00</span></div>
                    <div class="fr selected" id="selected">已选商品<span id="selectedTotal">0</span>件<span class="arrow up">︽</span><span class="arrow down">︾</span></div>
                    <div class="selected-view">
                        <div id="selectedViewList" class="clearfix">
                            <div><img src="images/1.jpg"><span>取消选择</span></div>
                        </div>
                        <span class="arrow">◆<span>◆</span></span>
                    </div>
                </div>

                <!-- 购物车结束 -->

             
                    
            </div>
        
    </div>
</div>


    <script type="text/javascript" src="{{url('/ho/js/mycart.js')}}"></script>
    <script type="text/javascript" src="{{url('/ho/js/jquery.js')}}"></script>
    <script type="text/javascript" src="{{url('/ho/js/global-v2.js')}}"></script>

    <script type="text/javascript" src="{{url('/ho/js/tab.js')}}"></script>
    <script type="text/javascript" src="{{url('/ho/js/CartController.js')}}"></script>
    <script type="text/javascript">
        window.onload=function(){
            alert($);
        }

        $(function () {
            //手机易果
            $('.mobile').hover(function(){
                $(this).addClass('current');
            },function(){
                $(this).removeClass('current');
            }); 


        //我的易果
        $('.myyiguo').hover(function(){
            $(this).addClass('current');
        },function(){
            $(this).removeClass('current');
        });

        $(".cart-slct-box .chk input").click(
            function(){
                $("#insulationCan").toggle();    
            }
        );
        var sExchangeBuy=$(".preferential-buy").html();
        if($.trim(sExchangeBuy)=="")
        {
            $(".preferential-buy").hide()
        }else{
            $(".preferential-buy").html(sExchangeBuy);
        }

    //适应分辨率
    var screenWidth = window.screen.width;
    if (screenWidth < 1300) {
        document.write()
        $('.w').addClass('w1280');
    }
    //结算样式浮动
    $(window).scroll(scrollSettle);
    scrollSettle();
    function scrollSettle() {
        var spaceTop = $('.settle-space').offset().top,
            scrollTop = $(window).scrollTop(),
            windowHeight = $(window).height(),
            elementTop = spaceTop - windowHeight;
        if (elementTop < scrollTop) {
            $('.settle').removeClass('settle-fixed');
        }
        else {
            $('.settle').addClass('settle-fixed');
        }
    }

    
    
    </script>

@endsection